<template>
    <div class="uc-menu">
      <ul>
        <li v-for="(item, index) in menuItems" :key="index" @click="selectMenu(item)">
          {{ item }}
        </li>
      </ul>
    </div>
  </template>
  
  <script>
  export default {
    props: {
      menuItems: {
        type: Array,
        required: true,
      }
    },
    methods: {
      selectMenu(item) {
        this.$emit('itemSelected', item);
      }
    }
  };
  </script>
  
  <style scoped>
  .uc-menu {
    flex: 1; /* 占用剩余空间 */
    background-color: #f5f5f5;
    border-right: 1px solid #eaeaea;
  }
  
  .uc-menu ul {
    list-style-type: none;
    padding: 0;
  }
  
  .uc-menu li {
    padding: 10px;
    cursor: pointer;
    transition: background-color 0.3s;
  }
  
  .uc-menu li:hover {
    background-color: #eaeaea;
  }
  </style>
  